<?php
namespace app\admin\model;

class BondRate extends Base{

	protected $name = 'bond';
	const GOVERNMENT_BONDS = 2.83;

    //查询债券利率
    public function bondRate($arr=[]){

    	$reVal['interest_rate'] = self::GOVERNMENT_BONDS;
    	$where = [];
    	if(!empty($arr['sid']) || !empty($arr['stock_code'])){
    		
    		$where = ['sid'=>$arr['sid'], 'stock_code'=>$arr['stock_code'],'bond_typd'=>3];
    	}else{

    		$where = ['bond_typd'=>0];
    	}
    	$reVal = $this->where($where)->find()->toArray();
    	return $reVal;
    }
}